import Vue from 'vue'
import VueRouter from 'vue-router'
import hello from '../components/router/hello'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'hello',
    component: hello
  },
  {
    path: '/hellos/:id',
    name: 'hellos',
    component: () => import('../components/router/hellos'),
    props: true,
    children: [
      {
        path: '/child',
        name: 'child',
        component: () => import('../components/router/child'),
      }
    ]
  },
  {
    path: '/about/:id',
    name: 'about',
    component: () => import('../components/router/about'),
    props: true,
  }
]

const router = new VueRouter({
  routes
})

export default router
